home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / eco30603.zip / ECO30603.LZH / ECO_MOU.INC < prev    next >
Text File  |  1993-03-08  |  2KB  |  67 lines

  1.  
  2. type
  3.   mouseaction = (mleft, mmiddle, mright, mboth, mmove, mnoaction);
  4.   reflowinfo = record { for powertools menus }
  5.     off, hioff:    byte;
  6.     key       :   _keys;
  7.     prot      : boolean;
  8.   end;
  9.  
  10.  
  11. var
  12.   { mouse }
  13.   keypoller      : pointer;
  14.   moldx, moldy   :    word;
  15.  
  16.   procedure __coordmou(var x: word; var y: word);
  17.   function  __funcmou(var b: word; var x: word; var y: word): mouseaction;
  18.   function  __isboxmou(x1, y1, x2, y2, cx, cy: word): boolean;
  19.  
  20.  
  21.  
  22.  
  23. implementation
  24.  
  25.  
  26.  
  27.   function __coordmou;
  28.   begin
  29.     x := (x+8) div 8; y := (y+8) div 8
  30.   end;
  31.  
  32.  
  33.  
  34.  
  35.   function  __funcmou(var b: word; var x: word; var y: word): mouseaction;
  36.   var
  37.     buttons,
  38.     moux, mouy :        word;
  39.     react      : mouseaction;
  40.  
  41.   begin
  42.     __statmou(buttons, moux, mouy);
  43.     react := mnoaction;
  44.     if ((buttons and _left_sup) > 0) then react := mleft;
  45.     if ((buttons and _right_sup) > 0) then react := mright;
  46.     if ((buttons and _middle_sup) > 0) then react := mmiddle;
  47.     if ((buttons and _left_sup) > 0) and ((buttons and _right_sup) > 0) then
  48.       react := mboth;
  49.     if (moldx <> moux) or (moldy <> mouy) then react := mmove;
  50.     moldx := moux; moldy := mouy;
  51.     b := buttons; x := moux; y := mouy;
  52.     __funcmou := react;
  53.   end;
  54.  
  55.  
  56.  
  57.   function  __isboxmou(x1, y1, x2, y2, cx, cy: word): boolean;
  58.   begin
  59.     __isboxmou := (cx >= x1) and (cx <= x2) and (cy >= y1) and (cy <= y2);
  60.   end;
  61.  
  62.  
  63.  
  64. begin
  65.   keypoller := nil;
  66. end. { unit }
  67.